<template>
  <div>
    <button @click="handleClick">
      返回
    </button>
    <div>
      {{ x }} {{ y }}
    </div>
  </div>
</template>

<script>
  export default {
    props: ['x', 'y'],
    methods: {
      handleClick() {
        // 编程式导航
        // this.$router.back()

        // this.$router.push(`/index/mall/products/001`)

        // this.$router.push({
        //   path: `/index/mall/products/001`
        // })

        this.$router.push({
          name: 'products',
          params: {
            id: '001'
          }
        })
      }
    },
    mounted() {
      const { a, b } = this.$route.meta
      console.log(a, b)
    }
  }
</script>

<style scoped>

</style>